package com.lx.domain;

import java.text.SimpleDateFormat;
import java.util.Date;

import Tools.Sformat;

public class SharingResource {
	private Integer id ;
	private String resourceName;
	private String resourceDes;
	private String resourceType;
	private String resourceAdress;
	private String resourceUrl;
	private Date creatDate;
	private int correlationID ;
	private int downloadCount;
	
	
	public Integer getId() {
		return id;
	}


	public void setId(Integer id) {
		this.id = id;
	}


	public String getResourceName() {
		return resourceName;
	}


	public void setResourceName(String resourceName) {
		this.resourceName = resourceName;
	}


	public String getResourceDes() {
		return resourceDes;
	}


	public void setResourceDes(String resourceDes) {
		this.resourceDes = resourceDes;
	}


	public String getResourceType() {
		return resourceType;
	}


	public void setResourceType(String resourceType) {
		this.resourceType = resourceType;
	}


	public String getResourceAdress() {
		return resourceAdress;
	}


	public void setResourceAdress(String resourceAdress) {
		this.resourceAdress = resourceAdress;
	}


	public String getResourceUrl() {
		return resourceUrl;
	}


	public void setResourceUrl(String resourceUrl) {
		this.resourceUrl = resourceUrl;
	}


	public Date getCreatDate() {
		return creatDate;
	}


	public void setCreatDate(Date creatDate) {
		this.creatDate = creatDate;
	}


	public int getCorrelationID() {
		return correlationID;
	}


	public void setCorrelationID(int correlationID) {
		this.correlationID = correlationID;
	}


	public int getDownloadCount() {
		return downloadCount;
	}


	public void setDownloadCount(int downloadCount) {
		this.downloadCount = downloadCount;
	}
	
	public String getResourceTypeDes(){
		switch (resourceType) {
		case "W":
			return "windows" ;
			
		case "U":
			return "ubuntu" ;
			
		case "D":
			return "安装文档" ;
			
		default:
			return "其他软件" ;
			
		}
	}
	
	public String getResourceDateStr(){
		SimpleDateFormat sd =new SimpleDateFormat("yyyy-MM-dd");
		return sd.format(creatDate) ;
	}


	@Override
	public String toString() {
		return "SharingResource [id=" + id + ", resourceName=" + resourceName
				+ ", resourceDes=" + resourceDes + ", resourceType="
				+ resourceType + ", resourceAdress=" + resourceAdress
				+ ", resourceUrl=" + resourceUrl + ", creatDate=" + creatDate
				+ ", correlationID=" + correlationID + ", downloadCount="
				+ downloadCount + "]";
	}


	public SharingResource(Integer id, String resourceName, String resourceDes,
			String resourceType, String resourceAdress, String resourceUrl,
			Date creatDate, int correlationID, int downloadCount) {
		super();
		this.id = id;
		this.resourceName = resourceName;
		this.resourceDes = resourceDes;
		this.resourceType = resourceType;
		this.resourceAdress = resourceAdress;
		this.resourceUrl = resourceUrl;
		this.creatDate = creatDate;
		this.correlationID = correlationID;
		this.downloadCount = downloadCount;
	}


	public SharingResource() {
		super();
		// TODO Auto-generated constructor stub
	}
	
	
}
